#include <iostream> 
using namespace std; 
int fact(int n){
	int result = 1;
	for (int i = 1;i<=n;i++){ //时间复杂度 O(n)
		result = result * i;
	}
	return result;
}

int main(){
	int n;
	cout << "请输入n: ";
	cin >> n;
	cout << n<< "的阶乘是: " <<fact(n)<<endl;
	return 0;
}
